package net.lijingye.education.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.SerializerFeature;
import net.lijingye.education.entity.Friend;
import net.lijingye.education.util.CommonUtil;

/**
 * Created by LijingYe on 2016/3/26.
 */
public class FriendVO {
    @JSONField(name = "id", ordinal = 0, serialzeFeatures = SerializerFeature.WriteMapNullValue)
    private String id;
    @JSONField(name = "name", ordinal = 1, serialzeFeatures = SerializerFeature.WriteMapNullValue)
    private String name;
    @JSONField(name = "faceIcon", ordinal = 2, serialzeFeatures = SerializerFeature.WriteMapNullValue)
    private String faceIcon;
    @JSONField(name = "home", ordinal = 3, serialzeFeatures = SerializerFeature.WriteMapNullValue)
    private String home;

    public FriendVO(Friend friend){
        this.id=friend.getFriend().getId();
        this.name= CommonUtil.getUserDisplayName(friend.getFriend());
        this.faceIcon=friend.getFriend().getFaceIcon();
        this.home=CommonUtil.getUserHomeText(friend.getFriend());
    }

    public FriendVO(String id, String name, String faceIcon, String home) {
        this.id = id;
        this.name = name;
        this.faceIcon = faceIcon;
        this.home = home;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getFaceIcon() {
        return faceIcon;
    }

    public void setFaceIcon(String faceIcon) {
        this.faceIcon = faceIcon;
    }

    public String getHome() {
        return home;
    }

    public void setHome(String home) {
        this.home = home;
    }

    @Override
    public String toString() {
        return "FriendVO{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", faceIcon='" + faceIcon + '\'' +
                ", home='" + home + '\'' +
                '}';
    }
}
